/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package charlie.shop.warehouse;

import com.charlie.sessions.WarehouseFacadeLocal;
import java.io.IOException;
import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Vitalii D
 */

@WebServlet(name = "ListOfWH", urlPatterns = {"/warehouse/ListOfWH"})
public class ListOfWH extends HttpServlet {

    @EJB
    private WarehouseFacadeLocal warehouse;
    
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        
        request.setAttribute("warehouse_list", warehouse.findAll());
        getServletContext().getRequestDispatcher("/warehouse/editWH/listOfWH.jsp").forward(request, response);
    }
}
